package com.linkage.jz.bankruptcy.activity.Vote;

import android.os.Bundle;
import android.view.View;

import com.linkage.jz.bankruptcy.base.BaseActivity;
import com.linkage.jz.bankruptcy.utils.StatusBarUtil;
import com.linkage.jz.bankruptcy.widget.ShapeLoadingDialog;

public abstract class ProVoteBaseActivity extends BaseActivity implements View.OnClickListener {

    private ShapeLoadingDialog shapeLoadingDialog;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        StatusBarUtil.setRootViewFitsSystemWindows(this,true);
        StatusBarUtil.setTranslucentStatus(this);
        if (!StatusBarUtil.setStatusBarDarkTheme(this, true)) {
            StatusBarUtil.setStatusBarColor(this,0x55000000);
        }
        shapeLoadingDialog = new ShapeLoadingDialog(this);
    }

    protected void showLoading() {
        if(null != shapeLoadingDialog) {
            shapeLoadingDialog.setLoadingText("加载中...");
            shapeLoadingDialog.setCanceledOnTouchOutside(false);
            shapeLoadingDialog.show();
        }
    }

    protected void hideLoading() {
        if(null != shapeLoadingDialog) {
            shapeLoadingDialog.dismiss();
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }
}
